//package com.example.tests;

import com.thoughtworks.selenium.*;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import java.util.regex.Pattern;

public class Con_Registration_InlineErrorsChecker extends SeleneseTestCase {
	@Before
	public void setUp() throws Exception {
		selenium = new DefaultSelenium("localhost", 4444, "*chrome", "http://www.gfwfn.com/");
		selenium.start();
	}

	@Test
	public void testUntitled() throws Exception {
		selenium.open("/");
		selenium.click("css=img[alt=\"Enroll\"]");
		selenium.waitForPageToLoad("30000");
		selenium.type("id=txtZip", "01234");
		selenium.type("id=txtRadius", "10");
		selenium.click("name=submit");
		selenium.waitForPageToLoad("60000");
		selenium.click("link=Test Dealership");
		selenium.waitForPageToLoad("30000");
		selenium.open("/Registration.php?ID=994f06ea-91e5-49d9-8864-1e0c5949b3e8&dn=VGVzdCBEZWFsZXJzaGlw");
		selenium.click("name=submit");
		verifyTrue(selenium.isTextPresent("You missed 9 fields. They have been highlighted below"));
		selenium.type("id=txtFirstName", "Thomas");
		selenium.click("name=submit");
		verifyTrue(selenium.isTextPresent("You missed 8 fields. They have been highlighted below"));
		selenium.type("id=txtLastName", "Thompson");
		selenium.click("name=submit");
		verifyTrue(selenium.isTextPresent("You missed 7 fields. They have been highlighted below"));
		selenium.type("id=txtAddress", "1 American Road");
		selenium.click("name=submit");
		verifyTrue(selenium.isTextPresent("You missed 6 fields. They have been highlighted below"));
		selenium.type("id=txtCity", "Dearborn");
		selenium.click("name=submit");
		verifyTrue(selenium.isTextPresent("You missed 5 fields. They have been highlighted below"));
		selenium.select("id=selState", "label=Michigan");
		selenium.click("css=option[value=\"MI\"]");
		selenium.click("name=submit");
		verifyTrue(selenium.isTextPresent("You missed 4 fields. They have been highlighted below"));
		selenium.click("name=submit");
		verifyTrue(selenium.isTextPresent("You missed 3 fields. They have been highlighted below"));
		selenium.type("name=txtEmail", "thomasjohn@net.net");
		selenium.click("name=submit");
		verifyTrue(selenium.isTextPresent("You missed 2 fields. They have been highlighted below"));
		selenium.click("name=submit");
		selenium.click("id=cbOver18");
		selenium.click("name=submit");
		verifyTrue(selenium.isTextPresent("You missed 1 field. It has been highlighted below"));
		selenium.click("id=cbRules");
		selenium.click("name=submit");
		selenium.waitForPageToLoad("30000");
		
		}

	@After
	public void tearDown() throws Exception {
		selenium.stop();
	}
}
